Unifying LL and LR parsing

نویسنده

  • Wim Pijls
چکیده

In parsing theory, LL parsing and LR parsing are regarded to be two distinct methods. In this paper the relation between these methods is cla-riied. As shown in literature on parsing theory, for every context-free grammar, a so-called non-deterministic LR(0) automaton can be constructed. Here, we show, that traversing this automaton in a special way is equivalent to LL(1) parsing. This automaton can be transformed into a deterministic LR-automaton. The description of a method to traverse this automaton results into a new formulation of the LR parsing algorithm. Having obtained in this way a relationship between LL and LR parsing, the LL(1) class is characterised, using several LR-classes.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

LLLR Parsing: a Combination of LL and LR Parsing

A new parsing method called LLLR parsing is defined and a method for producing LLLR parsers is described. An LLLR parser uses an LL parser as its backbone and parses as much of its input string using LL parsing as possible. To resolve LL conflicts it triggers small embedded LR parsers. An embedded LR parser starts parsing the remaining input and once the LL conflict is resolved, the LR parser p...

متن کامل

Ch(k) Grammars: A Characterization of LL(k) Languages

From the point of view of parsing the LL(K] grammars constitute a very attractive class of context-free grammars. For each LL{K] grammar a top-down parsing algorithm can be devised which is essentially a one-state deterministic push-down automaton. From a more theoretiG point of view LL[K) grammars are attractive as well. It is well-known, for example, that it is decidable whether two LLfk) gra...

متن کامل

Lr Parsing = Grammar Transformation + Ll Parsing Making Lr Parsing More Understandable and More Eecient

The paper has three aims. Its primary focus is a derivation method which is | in contrast to many of the classical presentations in the literature | easy to comprehend and thus easy to adapt to di erent needs. Secondly, it presents an improved LR parser which has the power of LR parsing, but (almost) the e ciency of LALR parsing. Finally, it elucidates the strong conceptual relationships that a...

متن کامل

Parsing methods streamlined

This paper has the goals (1) of unifying top-down parsing with shift-reduce parsing to yield a single simple and consistent framework, and (2) of producing provably correct parsing methods, deterministic as well as tabular ones, for extended context-free grammars (EBNF ) represented as state-transition networks. Departing from the traditional way of presenting as independent algorithms the dete...

متن کامل

The Hierarchy of LR-Attributed Grammars

The problem of attribute evaluation during LR parsing is considered. Several definitions of LR-attributed grammars are presented. Relations of corresponding attribute grammar classes are analysed. Also the relations between LR-attributed grammars and LL-attributed grammars and between LR-attributed grammars and a class of one-pass attributed grammars based on left-corner grammars are considered.

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1993